home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
4th86_v4.zip
/
NUMTEST.4TH
< prev
next >
Wrap
Text File
|
1994-01-01
|
2KB
|
54 lines
( forget strt
: strt ; )
off printload
unsplit
20 block buffer
15 buffer b!
: getstrg buffer getlin ;
: makefp getstrg buffer 1+ fpeval drop ;
: fptest " floating point demonstration" ." crlf
" ============================" ." crlf
" ( FPoint assumed -- no need for decimal point -- try 22 and 7 ) " ." crlf
" give FPoint value of numerator " ." makefp crlf
" give FPoint denominator value " ." makefp crlf
" FPoint quotient is " ." f/ f. crlf crlf crlf ;
: makesp getstrg buffer 1+ val ;
: SPtest " single precision demonstration " ." crlf
" ============================== " ." crlf
" give single precision numerator " ." makesp crlf
" give single precision denominator " ." makesp crlf
" single precision quotient is " ." / . crlf crlf crlf ;
: DPtest " double precision demonstration " ." crlf
" ============================== " ." crlf
" give double precision numerator " ." makesp double crlf
" give double precision denominator " ." makesp double crlf
" double precision quotient is " ." ,/ ,. crlf crlf crlf ;
: makefp2 getstrg buffer 1+ gval drop ;
: fptest2 " alternative FPdemonstration" ." crlf
" ============================" ." crlf
" ( essential to insert decimal point -- try 22.0 and 7.0 ) " ." crlf
" give FPoint value of numerator " ." makefp2 crlf
" give FPoint denominator value " ." makefp2 crlf
" FPoint quotient is " ." f/ f. crlf ;
cls
fptest
sptest
dptest
fptest2